#include <boost/di.hpp>
#include "logger_interface.hpp" // Include only the interface

namespace di = boost::di;

// 使用工厂函数注入
auto createLoggerInjector = []
{
    return di::make_injector(
        di::bind<Logger>.to([]
                            { return createLogger(); }) // 假设createLogger是导出的工厂函数
    );
};

int main()
{
    auto injector = createLoggerInjector();
    auto service = injector.create<std::unique_ptr<Service>>(); // Service类依赖Logger
    service->log();                                             // 这里Service内部会使用Logger
    return 0;
}